<template>
    <a-drawer width="100%" :visible="visible" :body-style="{ paddingBottom: '80px', background: '#f0f2f5' }"
        placement="right" :get-container="false" :style="{ position: 'absolute' }" :closable="false"
        :footer-style="{ textAlign: 'right' }">
        <a-card class="mb-2">
            <a-row :gutter="24">
                <a-col :span="20">
                    <div class="flex flex-row text-center">
                        <div class="w-48 ">
                            <div class="mb-2">项目名称</div>
                            <div style="font-weight: 600;"> {{ info.proName || '无' }}</div>
                        </div>
                        <div class="w-48 ">
                            <div class="mb-2">项目编号</div>
                            <div style="font-weight: 600;"> {{ info.proCode || '无' }}</div>
                        </div>
                        <div class="w-32 ">
                            <div class="mb-2">投标结果</div>
                            <div style="font-weight: 600;">{{ info.bidResult || '无' }}</div>
                        </div>
                        <div class="w-32 ">
                            <div class="mb-2">发起人</div>
                            <div style="font-weight: 600;">{{ info.initiatorName || '无' }}</div>
                        </div>
                    </div>
                </a-col>
                <a-col :span="4" class="text-right">
                    <a-button @click="onClose" class="mr-2">返回</a-button>
                    <!-- <a-button type="danger" @click="onClose">分配踏勘任务</a-button> -->
                </a-col>
            </a-row>
        </a-card>

        <a-card>
            <a-tabs v-model:activeKey="activeKey">
                <a-tab-pane key="1" tab="详细信息">
                    <xminfo ref="xmInfoRef"></xminfo>
                </a-tab-pane>
                <a-tab-pane key="3" tab="竞争对手明细">
                    <rivaltable :data="rivalData"></rivaltable>
                </a-tab-pane>
                <a-tab-pane key="10" tab="审核流程">
                    <taskInfo :id="info.processId">
                    </taskInfo>
                </a-tab-pane>
            </a-tabs>
        </a-card>
    </a-drawer>
</template>
<script setup>
import { progressOptions } from '@/utils/constants.js'
import rivaltable from './rivaltable.vue'
import bidfiles from './bidfiles.vue'
import xminfo from './xminfo.vue'
import api from '@/api/pm/bid/index'
import taskInfo from '@/components/Task/info.vue'
const xmInfoRef = ref();
const rivalData = ref([]);

const info = ref({})

const show = (record) => {
    visible.value = true
    info.value = { ...record }
    xmInfoRef.value.show(record)
    if (record) {
        api.competitorPageByBid({ bidId: record.id }).then((res) => {
            rivalData.value = res.records;
        })
    }
}
defineExpose({
    show,
})

const visible = ref(false)
const activeKey = ref('1')

const emits = defineEmits(['OnClose'])
const onClose = (refresh) => {
    visible.value = false;
    emits('OnClose', refresh)
};



</script>
